#ifndef M_GLASS_MATERIAL
#define M_GLASS_MATERIAL
#include"material.h"
#include"../BxDF/Specular.h"
class GlassMaterial :public Material
{
private:
	const bool isTrans;
	const Float eta;
public:
	GlassMaterial(Float eta,bool isTrans=false) :eta(eta),isTrans(isTrans){}
	virtual shared_ptr<BSDF> createBSDF(Spectrum &color, P3 &norm, TransportMode mode)
	{
		shared_ptr<GlassBSDF> bsdf(new GlassBSDF(norm,eta));
		bsdf->addBxDF(new SpecularReflection(color));
		if (isTrans)
			bsdf->addBxDF(new SpecularTransmission(eta, color));
		return bsdf;
	}

};
#endif // !M_GLASS_MATERIAL

